package hashchainutil.common;

import org.springframework.context.annotation.Configuration;

//import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;

/**
 * @program: dcep-spring
 * @description:
 * @author: Mr.Li
 * @create: 2020-04-20 14:42
 **/
@Configuration
public class MybatisConfig {
    /*@Autowired*/
    /*private DataSourceProperties dataSourceProperties;*/


    /*@Bean(name = "dataSource")
    public DataSource dataSource() {

        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setUrl(dataSourceProperties.getUrl());
        System.out.println(dataSourceProperties.getUrl());
        dataSource.setDriverClassName(dataSourceProperties.getDriverClassName());
        dataSource.setUsername(dataSourceProperties.getUsername());
        dataSource.setPassword(dataSourceProperties.getPassword());

        return dataSource;

    }

    public SqlSessionFactory sqlSessionFactory() throws Exception {
        SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
        sqlSessionFactoryBean.setDataSource(dataSource());
        return sqlSessionFactoryBean.getObject();
    }*/
}
